<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="/WEB-INF/tag/c.tld"%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>代码生成器</title>
	<%@ include file="../include/style.jsp"%>
	<link href="${webRoot}/assets/jforest/css/jforest-tree.css" rel="stylesheet" media="screen">
	<%@ include file="../include/js.jsp"%>
	<script type="text/javascript" src="${webRoot}/assets/jforest/js/jforest-paging.js"></script>
	<script type="text/javascript" src="${webRoot}/assets/jforest/js/jforest-table.js"></script>
	<script type="text/javascript" src="${webRoot}/assets/jforest/js/jforest-form.js"></script>
	<script type="text/javascript" src="${webRoot}/assets/jforest/js/jforest-tree.js"></script>
</head>
<body>
<div class="container">
	<ol class="breadcrumb">
	  <li><a href="${webRoot}/">项目列表</a></li>
	  <li class="active">页面配置</li>
	</ol>
	<div class="row">
		<div class="col-lg-3">
			<section class="panel panel-default" style="min-height:700px;">
				<div class="panel-heading clearfix">
					<a href="${webRoot}/pageConfig/menu/config?pcode=${project.projectCode}" class="btn btn-info btn-xs pull-right">配置菜单</a>
				</div>
				<div class="panel-body"><div id="divPageTree"></div></div>
			</section>
		</div>
		<div class="col-lg-9">
			<section class="panel panel-default" style="min-height:700px;">
				<div class="panel-body">
				<ul class="nav nav-tabs">
					<li class="active"><a href="#configView" data-toggle="tab">基础配置试图</a></li>
					<li><a href="#entityPageView" data-toggle="tab">对象页面配置视图</a></li>
				</ul>
				<div class="tab-content">
					<div class="tab-pane active" id="configView">
						<section class="panel">
							<div class="panel-heading clearfix">
								<button type="button" class="btn btn-success pull-right">保存</button>
							</div>
							<div class="panel-body">
								<form action="#" method="post">
									<input type="hidden" name="projectCode" value="${project.projectCode}"/>
									<div class="form-group">
								    	<label>页面模版类型</label>
								    	<input type="text" readOnly class="form-control" name="templateType" value="${pageConfig.templateType}"/>
								  	</div>							
								</form>
							</div>
						</section>
					</div>
	  				<div class="tab-pane" id="entityPageView"></div>
				</div><!-- /.tab-content -->
				</div>
			</section>
		</div>
	</div>
</div>
	
<script type="text/javascript">
$(function(){
	$('#divPageTree').jfTree({
		ajax:{
			url:'${webRoot}/pageConfig/tree',
			param:function(node){
				return {
					code:'${project.projectCode}',
					pid:node.options.id
				}
			}
		},
		root:{
			id:null,
			name:'页面相关'
		},
		nodeClick:function(node){
			if(node.isLeaf=true){
				$('#entityPageView').load('${webRoot}/pageConfig/entity/edit',
					{code:'${project.projectCode}',entityCode:node.options.id},function(){
						$('a[href="#entityPageView"]').tab('show');
				});
			}
		}
	});
	
	$('#btnAddTable').click(function(){
		$('#tableView').load('${webRoot}/dbConfig/table/edit',{code:'${project.projectCode}'},function(){
			$('a[href="#tableView"]').tab('show');
		});
	});
	
	$('#entityPageView').load('${webRoot}/pageConfig/entity/edit',{code:'${project.projectCode}'});
	
});
</script>
</body>
</html>